﻿
CREATE PROCEDURE [dbo].[fares_GenereazaD394Parteneri]
	@CodUnitate smallint,
	@DataStart datetime,
	@DataEnd datetime
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	SELECT DISTINCT b.CUI,B.Denumire FROM [Documente] a JOIN Parteneri b ON a.IDPartener = b.IDPartener WHERE a.[CodUnitate]=@CodUnitate AND
	DataDoc>= @DataStart AND DataDoc<=@DataEnd  AND RTRIM(LTRIM(b.[AtributFiscal]))='RO'

END